﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<FriendTest.Media.Comment>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	AddBookComment
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　<%=Html.ActionLink("返回上一级", "BookInfoDetails", new { Model.First().ResourceID })%>
    <h2><%=Html.Encode(ViewData["MyTitle"] )%></h2>
    <br/><img src="<%=Html.Encode(ViewData["MyImageURL"]) %>" alt="<%= Html.Encode(ViewData["MyImageURL"])%>"/>
    <div>
        作者：<%= Html.Encode(ViewData["MyAuthor"])%>
        <br/>
        出版社：<%= Html.Encode(ViewData["MyPublisher"])%>
        <br/>
        出版年月：<%= Html.Encode(ViewData["MyPubDate"])%>
        <br/>
        页数：<%= Html.Encode(ViewData["MyPages"])%>
        <br/>
        定价：<%= Html.Encode(ViewData["MyPrice"])%>
        <br/>
        ISBN：<%= Html.Encode(ViewData["MyISBN"])%>
        <br/>
        评分：<%= Html.Encode(String.Format("{0:F}", ViewData["MyRatingAverage"]))%>(<%= Html.Encode(ViewData["MyNumRaters"])%>人评价)
        
    </div>
     <br/><%=Html.ValidationSummary("发表评论失败！") %>
    <%using (Html.BeginForm("AddCommentClick"))
      { %>
    <div>
    <%=Html.Hidden("resourceID", Model.First().ResourceID)%>
    <%=Html.Hidden("userID",ViewData["CurrentUserID"]) %>
        <br/><label>发表评论</label>
        <br/><%=Html.TextArea("NewComment")%>
        <%=Html.ValidationMessage("NewComment", "*")%>
        
    <br/><input type="submit" value="发表" />&nbsp;&nbsp;&nbsp;&nbsp;
    <%=Html.ActionLink("取消", "BookInfoDetails", new { Model.First().ResourceID })%>
    
    </div>
    <%} %>
    <div>
        <h5>内容简介</h5>
        &nbsp;&nbsp;&nbsp;&nbsp;<%= Html.Encode(ViewData["MySummary"])%>
    </div>
    <div>
        <h5>作者简介</h5>
        &nbsp;&nbsp;&nbsp;&nbsp;<%= Html.Encode(ViewData["MyAuthorIntro"])%>
    </div>
     <%if (Model.First().UserID == -1 && Model.Count() == 1)
      { %>
      
    <%} %>
    <%else
        {%>
        <div>
    <h5>评论</h5>
    <%for (int i = 1; i < Model.Count(); i++)
      {%>
      <br/><%= Html.Encode(String.Format("{0}楼：",i))%>
      <br /><%=Html.ActionLink(Html.Encode(ViewData["" + Model.ToArray()[i].UserID]),
                      "goToProfile", new { profileID = Model.ToArray()[i].UserID })%>
      <br/><%= Html.Encode(String.Format("{0:g}", Model.ToArray()[i].CommentTime))%>
      <br/><h5><%= Html.Encode(Model.ToArray()[i].CommentContent)%></h5>
      <br/><%= Html.Encode("----------------------------------------------------------")%>
      
        
        <br/><label>    </label>
    <%} %>
    </div>
    <%} %>
    
   
</asp:Content>